package com.mui.skins
{
	import fl.core.*;
	import flash.utils.*;
	
	public class SkinManager extends Object
	{
		private static var _skinObject:Dictionary = new Dictionary();
		
		public function SkinManager()
		{
		}
		
		public static function addStyleSkin(style:String, skin:Object) : void
		{
			_skinObject[style] = skin;
		}
		
		public static function getStyleSkin(style:String) : Object
		{
			return _skinObject[style];
		}
		
		public static function removeStyleSkin(style:String) : void
		{
			_skinObject[style] = null;
			delete _skinObject[style];
		}
		
		public static function setComponentStyle(component:UIComponent, style:String) : void
		{
			var skinstyle:SkinStyle = null;
			var classname:* = _skinObject[style] as Class;
			if (classname)
			{
				skinstyle = new classname as SkinStyle;
				skinstyle.setStyle(component);
			}
		}
	}
}
